-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix exception handling on Python 3.12 #3306
Conversation
5dbe51d
to
842b35a
Compare
842b35a
to
4692ac5
Compare
Pushed a more complete implementation which I'm happy with, and updated OP. |
I think best if I circle back to this later to split out into multiple PRs for the changes of behaviour / fixes etc. |
d9177ab
to
7c65b98
Compare
Assuming CI is green, I believe this is now good to review. |
On further reflection, I should be able to split this out to first make the |
I am pretty swamped at the moment, so anything that turns this into smaller chunks would be appreciated. |
👍 #3323 |
173dc9d
to
291b2e5
Compare
291b2e5
to
b0f07b1
Compare
Ok, I think this is as small a diff as it can possibly get. I split off the second commit into #3326. |
b0f07b1
to
0098f1f
Compare
0098f1f
to
ab07825
Compare
Reworked exception handling for Python 3.12. Ref #3305
The simplifications to
PyErrState
result in a ~10-15% perf improvement in thebench_err
benchmarks on all Python versions. On 3.12 the enum size has been reduced from 32 to 24 bytes, which might have small global perf benefits too.While working on this I noticed a bug on <3.12 where the original panic message is not retrieved properly in
PyErr::fetch
if thePanicException
is normalised. I've added that as a second commit.